gridpack::parallel::Shuffler< Thing, Index > Class Template Reference

A functor to redistribute things in vectors on multiple processes. More...

#include <shuffler.hpp>

Inheritance diagram for gridpack::parallel::Shuffler< Thing, Index >:
Inheritance graph
[legend]
Collaboration diagram for gridpack::parallel::Shuffler< Thing, Index >:
Collaboration graph
[legend]

List of all members.

Public Types

typedef std::vector< Thing > ThingVector
typedef std::vector< Index > IndexVector

Public Member Functions

 Shuffler (const Communicator &comm)
 ~Shuffler (void)
void operator() (ThingVector &locthings, const IndexVector &destproc)
 Redistribute and get the Things assigned to the local process.

Detailed Description

template<typename Thing, typename Index = int>
class gridpack::parallel::Shuffler< Thing, Index >

A functor to redistribute things in vectors on multiple processes.

Each process starts with a (possibly empty) vector of things and a vector of equal size that containing a destination process for each thing. After execution, each process will contain a vector of the things assigned to it.

This uses blocking send/receive.

The things redistributed must be copy constructable and serializable.


Member Typedef Documentation

template<typename Thing , typename Index = int>
typedef std::vector<Index> gridpack::parallel::Shuffler< Thing, Index >::IndexVector
template<typename Thing , typename Index = int>
typedef std::vector<Thing> gridpack::parallel::Shuffler< Thing, Index >::ThingVector

Constructor & Destructor Documentation

template<typename Thing , typename Index = int>
gridpack::parallel::Shuffler< Thing, Index >::Shuffler ( const Communicator comm  ) 
template<typename Thing , typename Index = int>
gridpack::parallel::Shuffler< Thing, Index >::~Shuffler ( void   ) 

Member Function Documentation

template<typename Thing , typename Index = int>
void gridpack::parallel::Shuffler< Thing, Index >::operator() ( ThingVector locthings,
const IndexVector destproc 
)

Redistribute and get the Things assigned to the local process.

References gridpack::parallel::Distributed::communicator().


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 3 Feb 2020 for GridPACK by  doxygen 1.6.1